<template>
  <div id="area">1223</div>
</template>



<script>
export default {
  data() {
    return {
      mxgraphData: [
        {
          nodesList: [
            [0, "宝鸡市"],
            [1, "渭南市"],
            [2, "西安市"],
            [3, "汉中市"],
            [4, "安康市"],
          ],
          edgesList: [
            [0, "200Km", 1],
            [1, "300km", 2],
            [1, "75Km", 3],
            [3, "100Km", 4],
            [4, "90Km", 5],
          ],
        },
      ],
    };
  },
  mounted:{
      createNodes(graph,parent){
        //   遍历mxgraphData生成节点
        var len = this.mxgraphData[0].nodesList.length;
        for (var i = 0 ; i < len; i++) {
            let text = this.mxgraphData[0].nodesList[i][1]
            let id = `node${this.mxgraphData[0].nodesList[i][0]}`;
            var node = graph.insertVertex(parent,id,0,0,150,40,  "fillColor=#3CAEA3;strokeColor=white;fontStyle=1;fontColor=white;rounded=1;fontSize=15;")

        }
      }
  }
};
</script>

<style>
</style>
